package com.flitsneak.designpatterns.structuralpatterns.proxy.staticproxy.proxy;

import com.flitsneak.designpatterns.structuralpatterns.proxy.staticproxy.subject.Fruits;
import com.flitsneak.designpatterns.structuralpatterns.proxy.staticproxy.subject.MissDuan;

/**
 * @author flitsneak
 * @email flitsneak@gmail.com
 * @date 2022/7/6 13:40
 * @description
 */
public class FeiFeiProxy implements Fruits {
    private MissDuan missDuan;

    public FeiFeiProxy(MissDuan missDuan){
        this.missDuan = missDuan;
    }

    @Override
    public void buyFruits() {
        this.preBuyFruits();
        missDuan.buyFruits();
        this.postBuyFruits();
    }

    public void preBuyFruits(){
        System.out.println("飞飝：请问段小姐要吃什么水果？水果送到哪里？");
    }

    public void postBuyFruits(){
        System.out.println("飞飝：分两批准时送达!");
    }
}
